package com.chhh.cranelease.controller.Integratedmanage;

import com.chhh.cranelease.entity.Repair;
import com.chhh.cranelease.model.RepairModel;
import com.chhh.cranelease.model.ResponseCode;
import com.chhh.cranelease.service.IntegratedmanageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("repair/")
public class RepairController {

    @Autowired
    private IntegratedmanageService integratedmanageService;

    private ResponseCode responseCode = new ResponseCode();

    @RequestMapping("selectAllRepair")
    public List<RepairModel> selectAllRepair(String r_num,Double r_lowcost,Double r_highcost){
       return integratedmanageService.selectAllRepair(r_num,r_highcost,r_lowcost);
    }
    @RequestMapping("updateRepair")
    public ResponseCode updateRepair(Repair repair){
        Integer repairs = integratedmanageService.updateRepair(repair);
        responseCode.setErrorCode(0);
        responseCode.setStatus("你更改了"+repairs+"条记录");
        return responseCode;
    }
}
